package facade;

import java.util.ArrayList;

import db.ImbiConnection;
import model.Employee;
import model.UserAccount;

public class EmployeeFacade {
	public static void deleteEmployee(Employee e){		
		if(e == null) return;
		ArrayList<UserAccount> users = ImbiConnection.getUserAccountDAO().findByEmployee(e.getId());
		for(UserAccount u: users){
			ImbiConnection.getUserAccountDAO().delete(u);
		}
		ImbiConnection.getEmployeeDAO().delete(e);
	}
}
